

X = rand(100, 2);

tform = maketform('affine', [0.5 0.2 0; 0.4 0.5 0; 3 4 1]);
[Xform, Yform] = tformfwd(tform, X(:,1)', X(:,2)');

[A b] = GetAffineMatrix(X(:,1)', X(:,2)', Xform, Yform)
[A1 b1] = GetAffineMatrix2(X(:,1)', X(:,2)', Xform, Yform)
